import request from '@/utils/request'

//添加药品到购物车中
export function addDrugToCartDrug(drugIds){
  return request({
    url: '/medicine/cart/'+drugIds,
    method: 'post'
  })
}

//删除对应的药品
export function deleteDrug(drugIds){
  return request({
    url: '/medicine/cart/'+drugIds,
    method: 'delete'
  })
}

//修改药品的数量
export function setDrugNum(drugId,durgNum){
  return request({
    url: '/medicine/cart/'+drugId+'/'+durgNum,
    method: 'put'
  })
}

//提交购物车订单
export function addCarToOrder(drugIds,supplierId){
  return request({
    url: '/medicine/order/'+drugIds+'/'+supplierId,
    method: 'post'
  })
}

//修改药品的工厂
export function setCarDrugFactory(drugId,factoryId){
  return request({
    url: '/medicine/cart/setFactory/'+drugId+'/'+factoryId,
    method: 'put'
  })
}

//获取所有的药品信息
export function getCarDrug(){
  return request({
    url: '/medicine/cart',
    method: 'get'
  })
}



